package com.blandware.atleap.webapp.form.core;

import javax.servlet.http.HttpServletRequest;
import com.blandware.atleap.webapp.form.BaseForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.upload.FormFile;
import org.apache.struts.upload.MultipartRequestHandler;
import java.util.Map;
import java.util.HashMap;

/**
 * @struts.form name="contentDocumentForm" 
 */
public  class ContentDocumentForm
    extends    ContentResourceForm
    implements java.io.Serializable
{

    protected String contentLocaleId;

    protected String charset;

    protected String id;

    protected String uri;

    protected String altUrl;

    protected Map descriptionMap;

    protected String size;

    protected String mimeType;

    protected String version;

    protected String lastUpdatedDatetime;

    /** Default empty constructor. */
    public ContentDocumentForm() {}

    public String getContentLocaleId()
    {
        return this.contentLocaleId;
    }

   /**
    * @struts.validator type="required"
    * @struts.validator-args arg0resource="core.contentResource.form.language"
    */
    public void setContentLocaleId(String contentLocaleId)
    {
        this.contentLocaleId = contentLocaleId;
    }

    public String getCharset()
    {
        return this.charset;
    }

   /**
    * @struts.validator type="required"
    */
    public void setCharset(String charset)
    {
        this.charset = charset;
    }

    public String getId()
    {
        return this.id;
    }

   /**
    */
    public void setId(String id)
    {
        this.id = id;
    }

    public String getUri()
    {
        return this.uri;
    }

   /**
    * @struts.validator type="required"
    * @struts.validator type="mask" msgkey="core.contentResource.errors.uri"
    * @struts.validator-args arg0resource="core.contentResource.form.uri"
    * @struts.validator-var name="mask" value="^(\/[a-zA-Z0-9\-_\040\.]+)+\.[a-zA-Z0-9]+$"
    */
    public void setUri(String uri)
    {
        this.uri = uri;
    }

    public String getAltUrl()
    {
        return this.altUrl;
    }

   /**
    */
    public void setAltUrl(String altUrl)
    {
        this.altUrl = altUrl;
    }

    public Map getDescriptionMap()
	{
		return this.descriptionMap;
	}
    public Object getDescription(String key)
	{
		return this.descriptionMap != null ? this.descriptionMap.get(key) : null;
	}

   /**
    */
    public void setDescriptionMap(Map descriptionMap)
	{
		this.descriptionMap = descriptionMap;
	}
    public void setDescription(String key, Object value)
	{
		if ( this.descriptionMap == null ) {
			this.descriptionMap = new HashMap();
		}
		this.descriptionMap.put(key, value);
	}

    public String getSize()
    {
        return this.size;
    }

   /**
    * @struts.validator type="long"
    */
    public void setSize(String size)
    {
        this.size = size;
    }

    public String getMimeType()
    {
        return this.mimeType;
    }

   /**
    */
    public void setMimeType(String mimeType)
    {
        this.mimeType = mimeType;
    }

    public String getVersion()
    {
        return this.version;
    }

   /**
    */
    public void setVersion(String version)
    {
        this.version = version;
    }

    public String getLastUpdatedDatetime()
    {
        return this.lastUpdatedDatetime;
    }

   /**
    * @struts.validator type="customdate"
    */
    public void setLastUpdatedDatetime(String lastUpdatedDatetime)
    {
        this.lastUpdatedDatetime = lastUpdatedDatetime;
    }

    /**
     * @see org.apache.struts.action.ActionForm#reset(org.apache.struts.action.ActionMapping,
     *                                                javax.servlet.http.HttpServletRequest)
     */
    public void reset(ActionMapping mapping, HttpServletRequest request) {
        // reset any boolean data types to false

        // reset all linking properties to null

        this.contentLocaleId = null;

// reset all mapped properties to default values

		this.descriptionMap = new HashMap();

    }

}
